package com.ymx.darling.spring.boot.autoconfigure;

import com.ymx.darling.bean.entity.dynamic.DynamicSchemaProcessor;
import com.ymx.darling.bean.entity.dynamic.DynamicTableProcessor;
import com.ymx.darling.bean.entity.fill.EntityFillProcessor;
import com.ymx.darling.intercept.ExecutorInterceptor;
import com.ymx.darling.logicdelete.LogicDeleteProcessor;
import com.ymx.darling.tenant.TenantFactory;
import com.ymx.darling.wrapper.UpdateWrapper;

import java.util.Map;
import java.util.function.Consumer;

/**
 * springBoot启动前的darling初始化器
 * @author 爱Java的小于
 */
public interface DarlingCustomizer {
    /**
     * 返回Executor拦截器
     * @return ExecutorInterceptor实例
     */
    default ExecutorInterceptor getExecutorInterceptor() {
        return null;
    }

    /**
     * 获取动态表名处理器
     * @return DynamicTableProcessor实例
     */
    default DynamicTableProcessor getDynamicTableProcessor() {
        return null;
    }

    /**
     * 获取动态schema处理器
     * @return DynamicSchemaProcessor实例
     */
    default DynamicSchemaProcessor getDynamicSchemaProcessor() {
        return null;
    }

    /**
     * 注册后置逻辑处理器
     * @return Consumer<UpdateWrapper>实例
     */
    default Consumer<UpdateWrapper> registerAfterSetLogicDeleteProcessor() {
        return null;
    }

    /**
     * 获取租户工厂
     * @return TenantFactory实例
     */
    default TenantFactory getTenantFactory() {
        return null;
    }

    /**
     * 获取实体填充处理器
     * @return EntityFillProcessor实例
     */
    default EntityFillProcessor getEntityFillProcessor() {
        return null;
    }

    /**
     * 返回逻辑删除处理器
     * @return Map
     */
    default Map<Class<?>, LogicDeleteProcessor> getLogicDeleteProcessorMap() {
        return null;
    }
}
